Opening  sql files opens new instance of SQL Management Studio

Hi Folks,

I'm sure this has been answered before but all my searches for this problem don't find what I need. It's a quirk but driving me nuts.

If I have sql management studio open and I view a sql file from Vault, or double-click it in explorer, it always opens a new instance of mgmt studio. I open 5 sql files, 5 instances of mgmt studio.

How do I tell my system to reuse mgmt studio to open sql files if it's open?

Thanks in Advance,

-David

March 7th, 2007 9:48pm

What version of SQL Server Management Studio do you have?

9.00.1399 = RTM
9.00.2047 = SP1
9.00.3042 = SP2

Paul A. Mestemaker II
Program Manager
Microsoft SQL Server Manageability
http://blogs.msdn.com/sqlrem/

Free Windows Admin Tool Kit Click here and download it now
March 8th, 2007 4:09am

Having the same issue. 9.00.3042. Thanks.
December 11th, 2008 5:13pm

Hello,

I have done a little try:
i have searched a 1st file with the extension .txt , double-click onit => the file is open in a 1st notepad window
i have searched a 2nd file with the extension .txt, double-click on it => the file is open in a 2nd notepad window
it is because the extension .txt is associated with the program notepad.exe
if you do the same thing with 2 files having the extension .sql, you will obtain 2 instances of ssms
it is because during the install of Sql Server, .sql is open thru Sql Server Management Studio on default

2 solutions :
- you don't double-click on a .sql file
- you suppress the association .sql <=>SSMS
for that :
click on start
click on config panel
click on folders oprions
click on the tab files types ( the 3rd one )
find the extension SQL
click on advanced
and unckech the checkbox : open with this program ( the hightlighted one )
and click on OK

I advice you to choose the 1st solution ( i am not sure that at the 1st update of Sql Server , the association will not be created )

You are facing to the way of the double-click is treated by Windows

Have a nice day
Free Windows Admin Tool Kit Click here and download it now
December 12th, 2008 8:24pm

You could drag and drop the file into studio manager also
December 14th, 2008 8:19pm

Iwas having this same issue - (but my co-workerswere not). It is an issue with the file association. I was able to fix it by restoring the default by going to:


Windows Explorer; Tools; Folder Options; File Types (tab); then select .sql extension. Mine did not have an advanced buttonlike many of the other extensions, but rather a "RESTORE" button in it's place. Apparently I kept looking right past the solution. I kept wondering why .sql did not have an ADVANCED button. Once I clicked RESTORE, all is good. Now the ADVANCED button shows also instead of the RESTORE. Thanks and have a great day
Dave


  • Proposed as answer by David Wanta Thursday, November 19, 2009 3:36 PM
  • Marked as answer by Kalman TothEditor Friday, November 20, 2009 8:04 PM
Free Windows Admin Tool Kit Click here and download it now
November 17th, 2009 7:54pm

This didn't work for me. Hitting restore set it back to opening with Visual Studio. But I want it to open with SSMS.
  • Proposed as answer by BAInnes Monday, February 08, 2010 8:45 PM
January 24th, 2010 6:19pm

I had the same problem.  I used to be able to open files with the .SQL extension into a single instance of SQL Server management studio.  My previous hard-drive failed, and when I reloaded the new one, I must have changed the order in which I installed Visual Studio and MSSQL, because VS became the new default application for SQL files.  I tried changing the file association to SQLWB.exe, but that gave me the multiple instance problem.  Hitting "Default" only changed the file association back to VS.  After a little trial and error, I believe I have the solution:

Delete the existing file type association for SQL.

Click “New” and enter SQL for the File Extension, then click “OK.”

The new file association should show at the top of your list, and the details should show in the frame below.

Click on “Advanced”.

To change the icon, click on the “Change Icon” button and browse to "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe" (if SQL Server is located on a different drive, adjust the path accordingly.)

Select the icon of your choice, and click “OK”.

Click the “Edit” button, fill in the page with the values below, then click “OK”:

 

Application used…:      "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWb.exe" /dde "%1"

Use DDE:                     Checked

DDE Message:             Open("%1")

Application:                  sqlwb.9.0

Topic:                           system

 

Click “OK” to save the changes, and “Close” to exit “Folder Options.”

  • Edited by BAInnes Monday, February 08, 2010 9:17 PM Missing command-line parameter
Free Windows Admin Tool Kit Click here and download it now
February 8th, 2010 8:53pm

I have the same problem with double-clicking a .sql file opening a new window each time.

I can't figure out how to do any of the above solutions in Windows 7. Could anyone help me out here?

November 25th, 2010 2:20pm

I have the same issue as above. The order of installation of Visual studio and SQL Server Management Studio seems to be the cause. Whilst I now can open my files in SQL Server Management Studio, I still have the rather annoying prompt to connect to Database Engine. It used to use the current database connection but now any files dragged onto the query window automatically prompt me to connect. Any ideas?
Free Windows Admin Tool Kit Click here and download it now
December 21st, 2010 9:12am

Hello MarkStevo,

Please, could you have a look on these links ?

http://blogs.msdn.com/b/psssql/archive/2008/08/28/sql-server-2008-express-net-framework-2-0-sp2-and-3-5-sp1-explained.aspx

http://blogs.msdn.com/b/psssql/archive/2008/08/11/sql-server-2008-visual-studio-2008-sp1-and-net-framework-3-5-sp1-explained.aspx

I think they should help you

Have a nice day

December 21st, 2010 10:30am

This DOES NOT WORK in windows 10. What do i do? Any Ideas?
Free Windows Admin Tool Kit Click here and download it now
August 18th, 2015 9:20pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics